package com.jiajia.study.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @Title: RabbitConfig
 * @Author zjj
 * @Package com.jiajia.study.config
 * @Date 2024/3/9 15:10
 * @description:
 */

@Component
public class RabbitConfigTtlMessage {

    @Bean
    public DirectExchange directExchangeA(){
        return ExchangeBuilder.directExchange("ttl.exchange.a").build();
    }

    @Bean
    public Queue queueA(){
        return QueueBuilder.durable("ttl.message_queue.a").build();
    }

    @Bean
    public Binding bindingA(DirectExchange directExchangeA,Queue queueA){
        return BindingBuilder.bind(queueA).to(directExchangeA).with("ttl.message");
    }



}
